<?xml version="1.0" encoding="UTF-8"?>
<!-- <!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd"> 
	Licensed to the Apache Software Foundation (ASF) under one or more contributor 
	license agreements. See the NOTICE file distributed with this work for additional 
	information regarding copyright ownership. The ASF licenses this file to 
	You under the Apache License, Version 2.0 (the "License"); you may not use 
	this file except in compliance with the License. You may obtain a copy of 
	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
	by applicable law or agreed to in writing, software distributed under the 
	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
	OF ANY KIND, either express or implied. See the License for the specific 
	language governing permissions and limitations under the License. -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:task="http://www.springframework.org/schema/task"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-contex
  		http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

	<!-- Allows us to use system properties as variables in this configuration 
		file -->
	<bean
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
		<property name="ignoreUnresolvablePlaceholders" value="false" />
		<property name="ignoreResourceNotFound" value="true" />
		<property name="locations">
			<value>classpath:standalone-broker.properties</value>
		</property>
	</bean>


	<broker id="broker" brokerName="broker-1" persistent="${activemq.broker.persistent}"
		useJmx="${activemq.jmx.useJmx}" xmlns="http://activemq.apache.org/schema/core"
		dataDirectory="${activemq.base}" tmpDataDirectory="${activemq.base}/tmp"
		startAsync="false">

		<!-- The managementContext is used to configure how ActiveMQ is exposed 
			in JMX. By default, ActiveMQ uses the MBean server that is started by the 
			JVM. For more information, see: http://activemq.apache.org/jmx.html -->
		<managementContext>
			<managementContext createConnector="${activemq.jmx.createConnector}"
				connectorPort="${activemq.jmx.port}" connectorHost="${activemq.jmx.host}" />
		</managementContext>

		<!-- For better performances use VM cursor and small memory limit. For 
			more information, see: http://activemq.apache.org/message-cursors.html Also, 
			if your producer is "hanging", it's probably due to producer flow control. 
			For more information, see: http://activemq.apache.org/producer-flow-control.html -->

		<networkConnectors xmlns="http://activemq.apache.org/schema/core">
			<networkConnector
				uri="${activemq.transportConnectors.server.discoveryURI}" />
		</networkConnectors>

		<!--destinationInterceptors>
			<virtualDestinationInterceptor>
				<virtualDestinations>
					<virtualTopic name=">" prefix="Consumer.*.VirtualTopic."
						selectorAware="false" />
				</virtualDestinations>
			</virtualDestinationInterceptor>
		</destinationInterceptors-->

		<!-- Configure message persistence for the broker. The default persistence 
			mechanism is the KahaDB store (identified by the kahaDB tag). For more information, 
			see: http://activemq.apache.org/persistence.html -->
		<amq:persistenceAdapter>


			<kahaDB directory="${activemq.base}/kahadb"
				lockKeepAlivePeriod="0" />

			<!-- levelDB directory="${activemq.base}/leveldb" lockKeepAlivePeriod="0" 
				/ -->

			<!-- <jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#postgres-ds" 
				lockKeepAlivePeriod="0" /> -->
		</amq:persistenceAdapter>


		<!-- The systemUsage controls the maximum amount of space the broker will 
			use before slowing down producers. For more information, see: http://activemq.apache.org/producer-flow-control.html -->
		<systemUsage>
			<systemUsage>
				<memoryUsage>
					<memoryUsage limit="${activemq.broker.systemUsage.memoryUsage}" />
				</memoryUsage>
				<storeUsage>
					<storeUsage limit="${activemq.broker.systemUsage.storeUsage}" />
				</storeUsage>
				<tempUsage>
					<tempUsage limit="${activemq.broker.systemUsage.tempUsage}" />
				</tempUsage>
			</systemUsage>
		</systemUsage>

		<!-- The transport connectors expose ActiveMQ over a given protocol to 
			clients and other brokers. For more information, see: http://activemq.apache.org/configuring-transports.html -->
		<transportConnectors>
			<transportConnector name="openwire"
				uri="${activemq.transportConnectors.server.uri}" discoveryUri="${activemq.transportConnectors.server.discoveryURI}" />
		</transportConnectors>

		<!-- destroy the spring context on shutdown to stop jetty -->
		<shutdownHooks>
			<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
		</shutdownHooks>

	</broker>

	<!-- This xbean configuration file supports all the standard spring xml 
		configuration options -->

	<!-- <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource"> -->
	<!-- <property name="serverName" value="localhost" /> -->
	<!-- <property name="databaseName" value="activemq" /> -->
	<!-- <property name="portNumber" value="5432" /> -->
	<!-- <property name="user" value="postgres" /> -->
	<!-- <property name="password" value="postgres" /> -->
	<!-- <property name="dataSourceName" value="postgres" /> -->
	<!-- <property name="initialConnections" value="1" /> -->
	<!-- <property name="maxConnections" value="30" /> -->
	<!-- </bean> -->

	<!-- MySql DataSource Sample Setup -->
	<!-- <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" 
		destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> 
		<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/> 
		<property name="username" value="activemq"/> <property name="password" value="activemq"/> 
		<property name="poolPreparedStatements" value="true"/> </bean> -->

	<!-- Oracle DataSource Sample Setup -->
	<!-- <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" 
		destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> 
		<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/> <property 
		name="username" value="scott"/> <property name="password" value="tiger"/> 
		<property name="poolPreparedStatements" value="true"/> </bean> -->

	<!-- Enable web consoles, REST and Ajax APIs and demos It also includes 
		Camel (with its web console), see ${ACTIVEMQ_HOME}/conf/camel.xml for more 
		info Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details -->
	<!--import resource="jetty.xml"/ -->

</beans>

